package com.ytjj.qmyx.admin.service.imService.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.mapper.ImKeyDescribeMapper;
import com.ytjj.qmyx.admin.model.ImKeyDescribe;
import com.ytjj.qmyx.admin.model.request.ImKeyDescribeReq;
import com.ytjj.qmyx.admin.model.vo.ImKeyDescribeVO;
import com.ytjj.qmyx.admin.model.vo.ImKeyVO;
import com.ytjj.qmyx.admin.service.imService.ImKeyDescribeService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AllArgsConstructor
public class ImKeyDescribeServiceImpl implements ImKeyDescribeService {

    private ImKeyDescribeMapper imKeyDescribeMapper;

    @Override
    public CommonPage<ImKeyDescribeVO> describeList(ImKeyDescribeReq imKeyDescribeReq) {
        PageHelper.startPage(imKeyDescribeReq.getPageNum(), imKeyDescribeReq.getPageSize());
        List<ImKeyDescribeVO> pageList = imKeyDescribeMapper.describeList(imKeyDescribeReq);
        return CommonPage.restPage(pageList);
    }

    @Override
    public int insertDescribe(ImKeyDescribe imKeyDescribe) {
        return imKeyDescribeMapper.insertDescribe(imKeyDescribe);
    }

    @Override
    public int updateDescribe(ImKeyDescribe imKeyDescribe) {
        return imKeyDescribeMapper.updateDescribe(imKeyDescribe);
    }

    @Override
    public int deleteDescribe(Integer id) {
        return imKeyDescribeMapper.deleteDescribe(id);
    }

    @Override
    public ImKeyDescribeVO selectDescribe(Integer id) {
        return imKeyDescribeMapper.selectDescribe(id);
    }

    @Override
    public List<ImKeyVO> selectKey(String shortcut) {
        return imKeyDescribeMapper.selectKey(shortcut);

    }
}
